/**
 * @copyright (c) YX Company.
 */
package com.ry.core.base.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.dao.DataAccessException;

import com.ry.core.base.model.SimpleModel;

/**
 * mybatis接口类
 * 
 * @author lqw
 */

public interface BatisDao {

	/**
	 * 根据id获取一个对象
	 * 
	 * @param id
	 * @return
	 * @throws DataAccessException
	 */
	public abstract SimpleModel get(String nameSpace, String id)
			throws DataAccessException;

	/**
	 * 根据条件查找对象集合
	 * 
	 * @param m
	 * @return
	 * @throws DataAccessException
	 */
	public abstract List<SimpleModel> findListByMap(String nameSpace,
			Map<String, Object> m) throws DataAccessException;

	/**
	 * 获取记录总数
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public abstract int selectCount(String nameSpace, Map<String, Object> m)
			throws DataAccessException;

	public abstract List<?> getList(String nameSpace) throws DataAccessException;

	/**
	 * 获取SqlSessionTemplate
	 */
	public SqlSessionTemplate getSqlSession();

}
